//
//  CartTableViewCell.m
//  xingfugangwan
//
//  Created by rainday on 14/12/26.
//  Copyright (c) 2014年 rainday. All rights reserved.
//

#import "CartTableViewCell.h"
#import "XFGWCart.h"


@implementation CartTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)modify:(id)sender
{
    UIButton *button = (UIButton *)sender;
    NSInteger num = [_numberLabel.text intValue];
    
    
    
    switch (button.tag) {
        case 404:
            if (num>1) {
                num-=1;
            }
            break;
        case 500:
            if (num<99) {
                num+=1;
            }
            break;
        default:
            break;
    }
    
    _numberLabel.text = [NSString stringWithFormat:@"%li",(long)num];
    XFGWCart *cart = [XFGWCart shareCart];
    [cart.dictionary setObject:_numberLabel.text forKey:_nameberLabel.text];
    
    
}
@end
